﻿<UserControl x:Class="HackingSilverlightCodeBrowser.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
    xmlns:ThisNS="clr-namespace:HackingSilverlightCodeBrowser"
    mc:Ignorable="d"
    d:DesignHeight="600" d:DesignWidth="800"> 
    <Grid x:Name="LayoutRoot" >  
        <Image Source="Resources/background2.png" Stretch="UniformToFill" />

        <TextBlock x:Name="NewVersion" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Top" Cursor="Hand" MouseLeftButtonDown="NewVersion_MouseLeftButtonDown" 
                       FontSize="12" Margin="20,20,5,5" Width="600" Height="25" Visibility="Collapsed" 
                       Text="NOTICE: a newer version is available on www.HackingSilverlight.net!" >
                <TextBlock.RenderTransform>
                    <TransformGroup>
                        <RotateTransform Angle="90" CenterX=".5" CenterY=".5"/> 
                    </TransformGroup>
                </TextBlock.RenderTransform>
        </TextBlock>
        
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200*" />
                <ColumnDefinition Width="500*" />
                <ColumnDefinition Width="100*" />
            </Grid.ColumnDefinitions>
            
            <Image Source="Resources/HackingSilverlightCover.png" Width="75" Height="100" Grid.Column="0" Stretch="Uniform"
               VerticalAlignment="Top" HorizontalAlignment="Center" Margin="10,10,0,0" Cursor="Hand" MouseLeftButtonDown="Image_MouseLeftButtonDown" />

            <ThisNS:WrapPanel x:Name="TagCloudPanel" Grid.Column="0" Width="120" Height="600" HorizontalAlignment="Center" VerticalAlignment="Top" 
                              Margin="10,120,0,0" Cursor="Hand"></ThisNS:WrapPanel>

            <ListBox x:Name="CodeSamplesList" Grid.Column="1" Margin="10,10,10,10" 
                     SelectionChanged="CodeSamplesList_SelectionChanged" Background="Transparent" >
            </ListBox>

            <TextBox HorizontalAlignment="Left" Grid.Column="2" x:Name="SearchBox" Width="100" Height="25" VerticalAlignment="Top" Margin="10,10,10,0" Text="" 
                     IsEnabled="True" SelectionChanged="SearchBox_SelectionChanged" />

            <TextBlock Text="reset" x:Name="ResetButton" Grid.Column="2" Width="50" Height="25" VerticalAlignment="Top" Margin="10,40,10,0" Cursor="Hand" 
                     HorizontalAlignment="Left" Foreground="White" MouseLeftButtonDown="ResetButton_MouseLeftButtonDown"/>
            
            <TextBlock Text="help" x:Name="HelpButton" Grid.Column="2" Width="50" 
                       Height="25" VerticalAlignment="Top" Margin="84,40,10,0" Cursor="Hand" 
                       HorizontalAlignment="Left" Foreground="White" MouseLeftButtonDown="HelpButton_MouseLeftButtonDown" />

            <Button x:Name="TestBtn" Content="test" Click="TestBtn_Click" Grid.Column="2" 
                    Margin="10,100,10,10" Height="50" Width="100" Visibility="Collapsed" />

            <TextBlock x:Name="EmailLink" Grid.Column="2" Text="add to library" Margin="0,0,10,50"  Foreground="White" HorizontalAlignment="Right" 
                       VerticalAlignment="Bottom" Cursor="Hand" MouseLeftButtonDown="EmailLink_MouseLeftButtonDown" />
            <TextBlock x:Name="ContributorsBox" Grid.Column="2" Text="contributors" Margin="0,0,10,30"  Foreground="White" HorizontalAlignment="Right" 
                       VerticalAlignment="Bottom" Cursor="Hand" MouseLeftButtonDown="ContributorsBox_MouseLeftButtonDown" />
            <TextBlock x:Name="VersionBx" Grid.Column="2" Margin="0,0,10,10"  Foreground="White" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
            
        </Grid>

        <Grid x:Name="InstallMe" Width="37" Height="199"  >
            <Image x:Name="InstallMeButton" Source="Resources/InstallMe.png" Width="37" Height="199" Cursor="Hand"  
                   MouseLeftButtonUp="InstallMeButton_MouseLeftButtonUp" >
                <Image.Effect>
                    <ThisNS:GrayScaleShader />
                </Image.Effect>
            </Image>
        </Grid> 
    </Grid>
</UserControl>
